#include <stdio.h>

int main(){
	int i,n,j;
	scanf("%d",&n);
	int s[n][n];
	int *p1=s[0],*p2=s[0];
	for ( i=n;i>0;i-- ){
		int cur = n-i+1;
		for ( j=0;j<i;j++ ){
			*p1=cur;
			*p2=cur;
			p1++;
			p2+=n;
		}
		p1=&s[cur][cur];
		p2=&s[cur][cur];
	}
	p1=s[0];
	for ( i=n;i>0;i-- ){
		for ( j=n;j>0;j-- ){
			printf("%d ",*p1);
			p1++;
		}
		printf("\n");
	}
	
}
